<header>
  <div class="right">
    开始时间：
    <span>
      <p-calendar [locale]="en" [(ngModel)]="startTime" showTime="showTime" hourFormat="24"></p-calendar>
    </span>
    结束时间：
    <span>
      <p-calendar [locale]="en" [(ngModel)]="endTime" showTime="showTime" hourFormat="24"></p-calendar>
    </span>
    <span>
      <button (click)="onSearch()">查询</button>
    </span>
  </div>
</header>
<main>
  <p-table [columns]="cols" [value]="data" [paginator]="true" [rows]="rows" [showCurrentPageReport]="true" [resizableColumns]="true" [(first)]="firstDay"
           currentPageReportTemplate="显示 {{firstDay}} 到 {{firstDay+rows}} 共 {{data.length}} 记录">
    <ng-template pTemplate="header" let-columns>
      <tr class="data-columns">
        <th style="width:10%;text-align: left" pResizableColumn>风场</th>
        <th style="width:10%;text-align: left" pResizableColumn>风机厂家</th>
        <!--<th style="width:10%;text-align: left" pResizableColumn>型号</th>-->
        <th style="width:10%;text-align: left" pResizableColumn>风机编号</th>
        <th style="width:10%;text-align: left" pResizableColumn>故障状态</th>
        <th style="width:10%;text-align: left" pResizableColumn>开始时间</th>
        <th style="width:10%;text-align: left" pResizableColumn>结束时间</th>
        <th style="width:10%;text-align: left" pResizableColumn>故障时长</th>
        <th style="width:10%;text-align: left" pResizableColumn>损失电量</th>
      </tr>
    </ng-template>
    <ng-template pTemplate="body" let-row let-columns="columns">
      <tr class="data-rows">
        <td class="ui-resizable-column">{{row.plant}}</td>
        <td class="ui-resizable-column">{{row.tbbrand}}</td>
        <!--<td class="ui-resizable-column">{{row.tbmodel}}</td>-->
        <td class="ui-resizable-column">{{row.fanno}}</td>
        <td class="ui-resizable-column">{{row.fanstate}}</td>
        <td class="ui-resizable-column">{{row.begintime}}</td>
        <td class="ui-resizable-column">{{row.endtime}}</td>
        <td class="ui-resizable-column">{{+row.intervalh && +row.intervalh.toFixed(5)}}</td>
        <td class="ui-resizable-column">{{+row.losspower && +row.losspower.toFixed(5)}}</td>
      </tr>
    </ng-template>
    <ng-template pTemplate="emptymessage" let-columns>
      <tr>
        <td [attr.colspan]="columns.length" style="text-align: center">
          没有数据
        </td>
      </tr>
    </ng-template>
  </p-table>
</main>
<p-confirmDialog header="Confirmation" width="300" acceptLabel="是" rejectLabel="否"></p-confirmDialog>
